<?php
namespace app\manage\model;
use think\Model;
use think\Db;
class Money extends Model{
    public function pushwater($manageid){
        $show = Db::name('pushwater as p')
            ->where('p.manageid',$manageid)
            ->join('indent i','p.indentid=i.id','left')
            ->join('agency a','i.agencyid=a.id','left')
            ->join('user m','p.manageid=m.id','left')
            ->field('p.*,i.dnumber,i.uptimes,i.reality,a.name as agencyname,m.name as managename')
            ->select();
        return $show;
    }
    function agrecord(){

        $db = Db::name('record')
            ->join('agency','agency.id = agencyid','left')
            ->field('agency.shop,agency.id as rid ,agencyid ,times, way ,money')
            ->select();
        return $db;
    }
}